package com.kkb.kkbportal.service.impl;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kkb.kkbcommon.exception.Asserts;
import com.kkb.kkbportal.dao.SpecialDao;
import com.kkb.kkbportal.domain.Special;
import com.kkb.kkbportal.service.SpecialService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: Administrator
 * @ClassName：SpecialServiceImpl
 * @User：面向对象面向君，不负代码不负卿
 * @Data：2021/8/15
 * @Time：17:21
 */
@Service
public class SpecialServiceImpl extends ServiceImpl<SpecialDao, Special> implements SpecialService {

    /**
     * 返回所有特点类集合
     *
     * @return 所有special
     */
    @Override
    public List<Special> listAll() {
        List<Special> list = this.lambdaQuery()
                .orderByDesc(Special::getUpdateTime)
                .list();
        if (CollUtil.isEmpty(list)) {
            Asserts.fail("未查到特点类信息");
        }
        return list;
    }
}
